package com.googlecode.mylyn.core;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

/**
 * Test for {@link PriorityUtil#convertToGoogle(PriorityLevel)}.
 */
@RunWith(Parameterized.class)
public class ConvertToGoogleTest {
    
    private final PriorityLevel level;
    
    private final String expected;

    public ConvertToGoogleTest(PriorityLevel level, String expected) {
        this.level = level;
        this.expected = expected;
    }
    
    @Parameters
    public static Collection<Object[]> data() {
      return Arrays.asList(
          new Object[]{PriorityLevel.P1, "Critical"},
          new Object[]{PriorityLevel.P2, "High"},
          new Object[]{PriorityLevel.P3, "Medium"},
          new Object[]{PriorityLevel.P4, "Low"},
          new Object[]{PriorityLevel.P5, null},
          new Object[]{null, null}
          );
    }
    
    @Test
    public void convertToGoogle() {
        assertEquals(LabelUtils.convertToGoogle(this.level), this.expected);
    }

}
